<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试Session2</title>
</head>
<body>
<%
	Date date=new Date();
	SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	out.println("Session名字："+session.getAttribute("name")+"<br>");
	out.println("SessionID："+session.getId()+"<br>");
	date.setTime(session.getCreationTime());
	out.println("Session创建时间："+session.getCreationTime()+"&nbsp&nbsp"+sdf.format(date)+"<br>");
	date.setTime(session.getLastAccessedTime());
	out.println("Session最后访问时间："+session.getLastAccessedTime()+"&nbsp&nbsp"+sdf.format(date)+"<br>");

%>
</body>
</html>